<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
    </style>
  </head>
  
  <body>

    <div class="x-body x-admin">

        <div class="layui-form">
          <div class="layui-form-item">
            <div class="layui-inline">
                <form action="{:url('staff/yeji')}">
                <input name="aid" value="{$aid}" type="hidden">
                <label class="layui-form-label">日期范围</label>
                <div class="layui-inline" id="date-search">
                    <div class="layui-input-inline">
                      <input type="text" autocomplete="off" name="startDate" id="startDate" vaule="{$startDate}" class="layui-input" placeholder="开始日期">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline">
                      <input type="text" autocomplete="off" name="endDate" id="endDate" vaule="{$endDate}" class="layui-input" placeholder="结束日期">
                    </div>

                    <div class="layui-form-mid"></div>
                    <div class="layui-input-inline">
                      <select name="status">
                        <option value="">全部</option>
                        <option value="1" {if condition="$status eq 1"}selected{/if}>洽谈</option>
                        <option value="3" {if condition="$status eq 3"}selected{/if}>保A</option>
                        <option value="4" {if condition="$status eq 4"}selected{/if}>签单</option>
                      </select>
                    </div>
                    <div class="layui-form-mid"></div>
                    <div class="layui-input-inline">
                        <button class="layui-btn layui-btn-primary layui-border-blue" lay-filter="add" lay-submit="">搜索</button>
                    </div>
                </div>
                </form>
            </div>
          </div>
        </div>
        {if condition="$startDate || $endDate"}
        <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
            <div carousel-item="">
                <ul class="layui-row layui-col-space10 layui-this">
                    <li class="layui-col-xs2" style="width: 120px;"></li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>客户量</h3>
                            <p><cite>{$count}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>录入量</h3>
                            <p><cite>{$luru}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>签单量</h3>
                            <p><cite>{$qiandan}</cite></p>
                        </a>
                    </li>
                </ul>
            </div>
        </div>


        {else}
        <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
            <div carousel-item="">
                <ul class="layui-row layui-col-space10 layui-this">
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本周客户量</h3>
                            <p><cite>{$z_count}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本周录入量</h3>
                            <p><cite>{$z_luru}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;margin-right:100px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本周签单量</h3>
                            <p><cite>{$z_qiandan}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本月客户量</h3>
                            <p><cite>{$y_count}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本月录入量</h3>
                            <p><cite>{$y_luru}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;margin-right:100px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>本月签单量</h3>
                            <p><cite>{$y_qiandan}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>总客户量</h3>
                            <p><cite>{$count}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>总录入量</h3>
                            <p><cite>{$luru}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-xs2" style="width: 120px;">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>总签单量</h3>
                            <p><cite>{$qiandan}</cite></p>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        {/if}
      <div class="layui-table-body layui-table-main" style="width: 100%;">
      <table class="layui-table layui-form">
        <thead>
          <tr>
            <th>ID</th>
            <th>活动名称</th>
            <th>活动地址</th>
            <th>活动时间</th>
            <!-- <th>客户姓名</th> -->
            <th style="text-align: center;">当前状态</th>
            <th>录入日期</th>
            <th>保A日期</th>
            <th>签单日期</th>
        </thead>
        <tbody>
          {volist name="clientRes" id="client"}
          <tr>
            <td>{$client.id}</td>
            <td>{$client.activity}</td>
            <td>{$client.address}</td>
            <td>{$client.activity_time}</td>
            <td style="text-align: center;">
                {switch name="$client.status" }
                    {case value="1"}洽谈中{/case}
                    {case value="2"}有意向{/case}
                    {case value="3"}已被保A{/case}
                    {case value="4"}已签单{/case}
                    {default /}
                {/switch}
            </td>
            <td>{$client.add_time|date="Y-m-d",###}</td>
            <td>{if condition="$client.baoA_time"}{$client.baoA_time|date="Y-m-d",###}{/if}</td>
            <td>{if condition="$client.qiandan_time"}{$client.qiandan_time|date="Y-m-d",###}{/if}</td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
    
      <div class="page">
        <div>
          {$clientRes->render()}
        </div>
      </div>
    </div>

    <script>
      layui.use(['form','layer','laydate'], function(){
        form = layui.form,
        layer = layui.layer,
        laydate = layui.laydate;

        laydate.render({
            elem: '#startDate',
            value : '{$startDate}'
        });
        laydate.render({
            elem: '#endDate',
            value : '{$endDate}'
        });

        /*laydate.render({
            elem: '#date-search'
            ,range: ['#startDate', '#endDate']
        });*/

      });

    </script>
  </body>

</html>